Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

309
Visualizações
Windows 10 Universal App - Type exists in both "Windows.Foundation.UniversalApiContract"

somehow (I have not even done anything) I get many erros in Visual Studio 2015 but I cant understand what the problem really is.

It says that a lot of "types" exists in both "Windows.Foundation.UniversalApiContract" libraries.

Can somebody help me? What can I do to rescue my solution and my project? I've tried to clean and rebuild it sometimes and this doesn't helped.

Errors in Visual Studio 2015

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Looks like you are referencing both the Windows 10 SDK metadata (UAP) and the Windows 8.1 SDK metadata (Windows). Are you mixing old and new binaries, or an old project file? Try to create a new project from scratch and added your sources.

over 4 years ago · Santiago Trujillo Relatório

0

I ran into something similar:

15178 errors, huh?

It's not fun. I think it started when I accidentally added an extension method to a set of utilities that I keep in a Portable Class Library project that referenced using Windows.ApplicationModel.DataTransfer; , since I (stupidly) added code that accessed the clipboard to the PCL. And that makes some sense; I am now effectively targeting two windows platforms, which is obviously wrong.

Added a few things to the csproj file of that PCL project. First was this line:

 <UseVSHostingProcess>false</UseVSHostingProcess>

The second was this ItemGroup:

 <ItemGroup> <Reference Include="Windows.Foundation.UniversalApiContract"> <HintPath>..\..\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.UniversalApiContract\2.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath> </Reference> </ItemGroup>

I'm not sure if all of this was necessary, but I removed the clipboard-related code, the reference to Windows.ApplicationModel.DataTransfer; in my using s, and reset/remove the changes to the csproj.

It still had a lot of the same bugs, though. I've found that doing clean rebuilds doesn't always work as expected, so I created a .bat file that I keep in the root of my startup project folder to run when I run into problems. First I have to close the solution in Visual Studio, and then I run...

 cd C:\Projects\solutionName\projectName cd ./bin rmdir x64 /S /Q rmdir x86 /S /Q rmdir ARM /S /Q cd ../obj/ rmdir x64 /S /Q rmdir x86 /S /Q rmdir ARM /S /Q cd .. pause

Now I also have to run that (again, with the solution closed) before building and submitting to the store. I'm not quite sure why, but doing both (removing the non-PCL code and resetting the PCL project and deleting those /bin and /obj folders) fixed the problem.

My unscientific hunch as to why I need to remove /bin and /obj is that VS doesn't always seem to build my projects in dependency order, and often references previous builds of my code when I should have started over. Destroying any possible antiquated crutch seems to force you to do things the right way. ¯\_(ツ)_/¯

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda